<template>
  <div class="login-container">
    <van-nav-bar
      title="登录"
      left-arrow
      @click-left="$router.push('/')"
      class="header"
    />
    <h2>优点达资讯</h2>
    <van-form @submit="onSubmit">
      <van-field
        v-model="mobile"
        name="用户名"
        label="用户名"
        placeholder="请输入手机号"
        :rules="[
          { required: true, message: '请输入手机号' },
          { pattern: /^1[3-9]\d{9}$/ ,message: '手机号格式错误' },
        ]"
        left-icon="manager"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        label="密码"
        placeholder="密码"
        :rules="[{ required: true, message: '请输入密码' },{pattern: /\d{6}/,message: '密码最少为6位字符'}]"
        left-icon="lock"
      />
      <div style="margin: 16px">
        <van-button round block type="info" native-type="submit"
          >提交</van-button
        >
      </div>
      <div class="zhuce" @click="$router.push('/zhuce')">
        没有账号，立即注册
      </div>
    </van-form>
  </div>
</template>

<script>
export default {
  name: "LieBiaoIndex",
  components: {},
  props: {},
  data() {
    return {
      mobile: "",
      password: "",
      isLogin: false,
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    onSubmit(values) {
      console.log("submit", values);
    },
  },
};
</script>
<style lang="less" scoped>
.login-container {
  .header {
    background-color: #1989fa;
  }
  /deep/ .van-nav-bar__title {
    color: #fff !important;
  }
  /deep/ .van-nav-bar .van-icon {
    color: #fff !important;
  }
  h2 {
    color: #1989fa;
    font-weight: 400;
    text-align: center;
  }
  .zhuce {
    position: absolute;
    right: 130px;
    font-size: 12px;
  }
}
</style>
